import { defineStore } from "pinia";
import { shallowRef } from "vue";
import { ApiRole } from "../../api";

export const useRoleStore = defineStore("role", () => {
 const list = shallowRef<UI.Role[]>([]);
  const queryHandler=async()=>{
    list.value = await ApiRole.get()
  }

 ApiRole.get().then((data) => {
    list.value = data
  });
  return { list, queryHandler };
});
